using System;
using System.Collections;
using System.Collections.Specialized;
using System.Web;
using System.Web.SessionState;

namespace WebMonitor.Http.Impl {
    /// <summary>
    /// Summary description for HttpSesssionStateAdapter.
    /// </summary>
    public class HttpSesssionStateAdapter : IHttpSessionState {
        private readonly HttpSessionState session;

        public HttpSesssionStateAdapter(HttpSessionState session) {
            this.session = session;
        }

        public void Abandon() {
            session.Abandon();
        }

        public void Add(string name, object value) {
            session.Add(name, value);
        }

        public void Remove(string name) {
            session.Remove(name);
        }

        public void RemoveAt(int index) {
            session.RemoveAt(index);
        }

        public void Clear() {
            session.Clear();
        }

        public void RemoveAll() {
            session.RemoveAll();
        }

        public IEnumerator GetEnumerator() {
            return session.GetEnumerator();
        }

        public void CopyTo(Array array, int index) {
            session.CopyTo(array, index);
        }

        public string SessionID {
            get { return session.SessionID; }
        }

        public int Timeout {
            get { return session.Timeout; }
            set { session.Timeout = value; }
        }

        public bool IsNewSession {
            get { return session.IsNewSession; }
        }

        public SessionStateMode Mode {
            get { return session.Mode; }
        }

        public bool IsCookieless {
            get { return session.IsCookieless; }
        }

        public HttpCookieMode CookieMode {
            get { throw new NotImplementedException(); }
        }

        public int LCID {
            get { return session.LCID; }
            set { session.LCID = value; }
        }

        public int CodePage {
            get { return session.CodePage; }
            set { session.CodePage = value; }
        }

        public HttpStaticObjectsCollection StaticObjects {
            get { return session.StaticObjects; }
        }

        public object this[string name] {
            get { return session[name]; }
            set { session[name] = value; }
        }

        public object this[int index] {
            get { return session[index]; }
            set { session[index] = value; }
        }

        public int Count {
            get { return session.Count; }
        }

        public NameObjectCollectionBase.KeysCollection Keys {
            get { return session.Keys; }
        }

        public object SyncRoot {
            get { return session.SyncRoot; }
        }

        public bool IsReadOnly {
            get { return session.IsReadOnly; }
        }

        public bool IsSynchronized {
            get { return session.IsSynchronized; }
        }
    }
}